//
//  GameCenter.m
//  QSBK
//
//  Created by Eric Wang on 4/28/15.
//  Copyright (c) 2015 Eric Wang. All rights reserved.
//

#import "GameCenter.h"

@interface GameCenter ()<UIWebViewDelegate>
- (IBAction)back:(id)sender;
@property (weak, nonatomic) IBOutlet UIWebView *webView;
@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end

@implementation GameCenter

- (void)viewDidLoad {
    [super viewDidLoad];
    
    CABasicAnimation* rotationAnimation;
    rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
    rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];
    rotationAnimation.duration = 1.5;
    rotationAnimation.cumulative = YES;
    rotationAnimation.repeatCount = MAXFLOAT;
    [self.imageView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
    NSString *urlString = @"http://www.ilongyuan.com.cn/qiubai/index.html";
    NSURL *URL = [NSURL URLWithString:urlString];
    NSURLRequest *request = [NSURLRequest requestWithURL:URL];
    self.webView.delegate = self;
    [self.webView loadRequest:request];
    // Do any additional setup after loading the view from its nib.
}



- (IBAction)back:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [self.imageView.layer removeAllAnimations];
    self.imageView.hidden = YES;
}
@end
